﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using System.Windows.Forms;
using ModularAndPlugin.WinApp.Composition;
using ModularAndPlugin.WinApp.Contracts;
using System.ComponentModel.Composition;

namespace UI.WinForm.DayDatas
{
    [MenuAttibute("Products")]
    public class DayDatasMenu : IMenu
    {
        private ToolStripMenuItem ProductsMainMenu;
        private ToolStripMenuItem ProductsConsultarMenu;
        private ToolStripMenuItem ProductsNovoMenu;

        private ToolStripMenuItem CreateMenu()
        {
            this.ProductsMainMenu = new System.Windows.Forms.ToolStripMenuItem();
            this.ProductsConsultarMenu = new System.Windows.Forms.ToolStripMenuItem();
            this.ProductsNovoMenu = new System.Windows.Forms.ToolStripMenuItem();

            // 
            // MenuProductsMain
            // 
            this.ProductsMainMenu.DropDownItems.AddRange(
                new System.Windows.Forms.ToolStripItem[] {
                    this.ProductsConsultarMenu,
                    this.ProductsNovoMenu});
            this.ProductsMainMenu.Name = "MenuDayDataMain";
            this.ProductsMainMenu.Text = "日数据";
            // 
            // MenuProductsConsultar
            // 
            this.ProductsConsultarMenu.Name = "MenuDayDataList";
            this.ProductsConsultarMenu.Text = "数据列表";
            this.ProductsConsultarMenu.Click += new EventHandler(DayDatasCommandFacade.MenuDataList);
            // 
            // MenuProductsNovo
            // 
            this.ProductsNovoMenu.Name = "MenuAddData";
            this.ProductsNovoMenu.Text = "数据维护";
            this.ProductsNovoMenu.Click += new EventHandler(DayDatasCommandFacade.MenuAddData);

            return ProductsMainMenu;
        }

        [ImportingConstructor()]
        public DayDatasMenu([Import(typeof(IModuleHandler))] IModuleHandler moduleHandler_)
        {
            CreateMenu();
            DayDatasCommandFacade.ModuleHandler = moduleHandler_;
        }

        public ToolStripMenuItem WinFormsMenu
        {
            get { return ProductsMainMenu; }
        }
    }
}
